/*
 * @Autor: dc
 * @Date: 2022-03-09 17:26:43
 * @LastEditors: dc
 * @LastEditTime: 2022-03-11 15:28:59
 * @Description: 
 */
import React, { Component } from 'react';

import './index.css'

class index extends Component {
    // 删除内容
    delTodos = () => {
        const { item, delTodos } = this.props;
        delTodos(item.id)
    }
    // 勾选内容
    checkTodos = () => {
        const { item, checkTodos } = this.props;
        checkTodos(item.id)
    }
    render() {
        const { done, name } = this.props.item;
        return (
            <div className='item'>
                <div>
                    <input type="checkbox" onChange={this.checkTodos} checked={done} />
                    {name}
                </div>
                <button className='delDutton' onClick={this.delTodos}>删除</button>
            </div>
        );
    }
}

export default (index);